package org.jeecg.modules.manage.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.manage.entity.CaishuiMember;

import java.util.List;
import java.util.Map;

/**
 * @Description: 签约人才表
 * @Author: yfkj
 * @Date:   2023-01-12
 * @Version: V1.0
 */
@InterceptorIgnore(tenantLine = "true")
public interface MCaishuiMemberMapper extends BaseMapper<CaishuiMember> {

    /**
     * 查询签约人才总数
     * @param params
     * @return
     */
    public long queryMemberTotal(@Param("params") Map<String, String> params);

    /**
     * 最近7天人才统计
     * @return
     */
    public List<Map<String,Object>> last7DaysMemberStatistics(@Param("params") Map<String, String> params);

    /**
     * 查询签约文件（自由者协议）
     *  ==暂时固定分类编码A01A01
     * @return
     */
    @Select("SELECT s.content FROM tb_article s WHERE s.`status` = 1 AND s.cata_id  = " +
            "(SELECT c.id FROM sys_category c WHERE c.code = 'A01A01') ORDER BY s.release_time DESC LIMIT 0,1")
    public String querySigningContent();

}
